# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fuse-exfat
_pkgreal=exfat
pkgver=1.3.0
pkgrel=1
pkgdesc="Free exFAT file system implementation"
url="https://github.com/relan/exfat"
arch="all"
license="GPL-2.0-or-later"
options="!check" # No test suite
provides="$_pkgreal"
depends="fuse"
makedepends="autoconf automake fuse-dev"
subpackages="$pkgname-doc $pkgname-utils"
source="$_pkgreal-$pkgver.tar.gz::https://github.com/relan/$_pkgreal/archive/v$pkgver.tar.gz
	0001-allow-command-line-argument-order-used-by-mount-8.patch
	"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	cd "$builddir"
	autoreconf --install
	./configure --prefix=/usr --sbindir=/sbin
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

utils() {
	pkgdesc="$pkgdesc (utilities)"
	provides="$_pkgreal-utils"
	mkdir -p "$subpkgdir"/sbin
	local file; for file in $(find "$pkgdir"/sbin ! -name "mount*" -a ! -type d); do
		mv $file "$subpkgdir"/${file#$pkgdir}
	done
}

sha512sums="fa3951e16889db65685e1fb71b0c75fc7014a8025c3442bf6164b94ddd51d282a8ae5e891c46195be53d2a10d62444e2fa1bb3fa3de59c2c3411c6dac363b488  exfat-1.3.0.tar.gz
1c3d61310f6a2f7b126d57825f7eee7acde46f809bb2f1eb9857b35c831b9499a4d63c39a76c4d67f85e8541565e6dafb7321fbe0cbe4af6d4fa6eb9f1c00dd1  0001-allow-command-line-argument-order-used-by-mount-8.patch"
